package API.AboutTime.SimpleDateFormatAPI;

import java.text.SimpleDateFormat;
import java.util.Date;

//将Date对象通过SimpleDateFormat的format方法转换为定义Simp...相应日期格式的字符串
public class DateToString {
    public static void main(String[] args) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 E HH:mm:ss");
        System.out.println(sdf.format(new Date()));
        System.out.println(sdf.format(new Date(0L)));
    }
}
